module.exports =  class SyncLoopHook {
  constructor(args){
      this.tasks = []
  }
  tap(name,task){
   this.tasks.push(task)
  }
  call(...args){
    for (let i = 0; i < this.tasks.length; i++) {
      const task = this.tasks[i];
      let ret;
      ret = task(...args)
      if(ret != undefined){
        this.call(...args)
        break;
      }
    }
  }
}
